import request from '@/utils/request'

/**
 * 会议个数本月
 * @returns {*}
 */
export function getMeetingCount () {
  return request({
    url: '/meeting/user/month/count',
    method: 'get'
  })
}

/**
 * 会议人数本月
 * @returns {*}
 */
export function getMeetingPepopleCount () {
  return request({
    url: '/meeting/user/pepople/count',
    method: 'get'
  })
}

/**
 * 所有会议信息
 * @param query 分页参数
 * @returns {*}
 */
export function getAllMeetingInfo (query) {
  return request({
    url: '/meeting/user/all/meeting/info',
    method: 'get',
    params: query
  })
}

/**
 * 同意会议
 *
 * @param id 会议id
 * @returns {*}
 */
export function agreeMeeting (id) {
  return request({
    url: `/meeting/manage/agree/${id}`,
    method: 'put'
  })
}

/**
 * 拒绝会议
 * @param ids 会议id
 * @param reason 拒绝理由
 * @returns {*}
 */
export function refusedMeeting (ids, reason) {
  return request({
    url: `meeting/manage/refused/${ids}?reason=${reason}`,
    method: 'put',
  })
}

/**
 * 查询我参加的指定的id的会议
 * @param id
 * @returns {*}
 */
export function getMeetingById(id){
  return request({
    url: '/meeting/manage/' + id,
    method: 'get'
  })
}

/**
 * 查询我发起的会议
 * @param query
 * @returns {*}
 */
export function getMeetingMine(query){
  return request({
    url: '/condition/ours/list',
    method: 'get',
    params: query
  })
}

/**
 * 查询我参与的会议
 * @param query
 * @returns {*}
 */
export function getParticipateMeeting(query){
  return request({
    url: '/meeting/user/participate/info',
    method: 'get',
    params: query
  })
}

/**
 * 预约会议
 * @returns {*}
 */
export function conferenceMeeting(query){
  return request({
    url: '/conference/all/invite',
    method: 'get',
    params: query
  })
}

// 获取当前登录用户的邀请人信息
export function getLoginUserInvitationInfo(queryParams) {
  return request({
    url: "/conference/all/invite",
    method: 'get',
    params: queryParams
  })
}

// 条件查询当前登录用户的邀请人信息
export function handleQueryInvitationInfo(queryParams) {
  return request({
    url: 'conference/terms/invite',
    method: 'get',
    params: queryParams
  })
}

// 根据用户id删除会议邀请
export function deleteMenuById(ids) {
  return request({
    url: `conference/del/terms/${ids}`,
    method: 'delete',
  })
}

// 添加会议邀请信息
export function addTermsInvitationInfo(data) {
  return request({
    url: 'conference/add/terms',
    method: 'post',
    data
  })
}
